#!/usr/bin/env python
# -*- coding: utf-8 -*-

import cv


def main():
    original_image = cv.LoadImage("beach.png")
    cv.NamedWindow("Original Image", cv.CV_WINDOW_AUTOSIZE)
    cv.NamedWindow("Output Image", cv.CV_WINDOW_AUTOSIZE)
    cv.NamedWindow("Other Output Image", cv.CV_WINDOW_AUTOSIZE)

    # Creamos imágenes vacías para utilizarlas de parámetro de salida:
    smoothed_image = cv.CreateImage(cv.GetSize(original_image),
        cv.IPL_DEPTH_8U, 3)
    truly_smoothed_image = cv.CreateImage(cv.GetSize(original_image),
        cv.IPL_DEPTH_8U, 3)
    cv.Smooth(original_image, smoothed_image, cv.CV_GAUSSIAN, 5, 5)
    cv.Smooth(original_image, truly_smoothed_image, cv.CV_GAUSSIAN, 29, 29)
    cv.ShowImage("Original Image", original_image)
    cv.ShowImage("Output Image", smoothed_image)
    cv.ShowImage("Other Output Image", truly_smoothed_image)
    cv.WaitKey(0)
    cv.DestroyWindow("Original Image")
    cv.DestroyWindow("Output Image")
    cv.DestroyWindow("Other Output Image")

if __name__ == '__main__':
    main()
